﻿using System.Collections.Generic;

namespace Bettzueche.RLGlue.TaskSpec {
    /// <summary>
    /// Definings of value ranges or number of chars respectively in an experiment.
    /// </summary>
    /// <seealso cref="ITaskSpec"/>
    public class RLTypesSpec {

        List<IntRange> _intRanges;
        /// <summary>
        /// Gets the discrete value ranges.
        /// </summary>
        /// <value>
        /// The discrete values (IntRanges).
        /// </value>
        public virtual IEnumerable<IntRange> Discrete { 
            get {return _intRanges;}
            protected set { ;} 
        }

        List<DoubleRange> _dblRanges;
        /// <summary>
        /// Gets the continious value ranges.
        /// </summary>
        /// <value>
        /// The continious values (DoubleRanges).
        /// </value>
        public virtual IEnumerable<DoubleRange> Continuous {
            get { return _dblRanges; }
            protected set { ;}
        }

        /// <summary>
        /// Gets or sets the expected char count.
        /// </summary>
        /// <value>
        /// The char count.
        /// </value>
        public virtual int CharCount { get; set; }

        public RLTypesSpec() {
            _intRanges = new List<IntRange>();
            _dblRanges = new List<DoubleRange>();
            CharCount = 0;
        }

        public virtual void AddDiscrete(IntRange disc) {
            if (disc != null)
                _intRanges.Add(disc);
        }

        public virtual void AddContinuous(DoubleRange cont) {
            if (cont != null)
                _dblRanges.Add(cont);
        }
    }
}
